package ca.etsmtl.log430.lab3;

/**
 * The purpose of this class is to initialize the system. First each component
 * is instantiated. This is where the component name and an ID is assigned.
 * Then, the executive component is started.
 * 
 * @author A.J. Lattanze, CMU
 * @version 1.2, 2011-Feb-24
 */

/*
 * Modification Log **********************************************************
 * 
 * v1.2, R. Champagne, 2011-Feb-24 - Various refactorings, conversion of
 * comments to javadoc format.
 * 
 * v1.1, R. Champagne, 2002-Jun-19 - Adapted for use at ETS.
 * 
 * v1.0, A.J. Lattanze, 12/29/99 - Original version.
 * ***************************************************************************
 */

public class SystemInitialize {

	public static void main(String argv[]) {
		Thread RegisterStudentComponent = new Thread(new RegisterStudent(
				new Integer(100), "RegisterStudentComponent"));

		RegisterStudentComponent.setDaemon(false);

		Thread ListStudentsComponent = new Thread(new ListStudents(new Integer(
				101), "ListStudentsComponent"));

		ListStudentsComponent.setDaemon(false);

		Thread ListCoursesComponent = new Thread(new ListCourses(new Integer(
				102), "ListCoursesComponent"));

		ListCoursesComponent.setDaemon(false);

		Thread ListCoursesRegisteredComponent = new Thread(
				new ListCoursesRegistered(new Integer(103),
						"ListCoursesRegisteredComponent"));

		ListCoursesRegisteredComponent.setDaemon(false);

		Thread ListStudentsRegisteredComponent = new Thread(
				new ListStudentsRegistered(new Integer(104),
						"ListStudentsRegisteredComponent"));

		ListStudentsRegisteredComponent.setDaemon(false);

		Thread ExecutiveComponent = new Thread(new Executive(new Integer(105),
				"ExecutiveComponent"));

		ExecutiveComponent.setDaemon(false);

		Thread ListPendingCompulsoryCoursesComponent = new Thread(
				new ListPendingCompulsoryCourses(new Integer(106),
						"ListPendingCompulsoryCoursesComponent"));

		ListPendingCompulsoryCoursesComponent.setDaemon(false);

		Thread ListCoursesTakenComponent = new Thread(new ListCoursesTaken(
				new Integer(107), "ListCoursesTakenComponent"));

		ListCoursesTakenComponent.setDaemon(false);

		Thread RegisterStudentIntelliSectionComponent = new Thread(
				new RegisterStudentIntelliSection(new Integer(108),
						"RegisterStudentIntelliSectionComponent"));

		RegisterStudentIntelliSectionComponent.setDaemon(false);

		// Start the system up

		RegisterStudentComponent.start();
		ListStudentsComponent.start();
		ListCoursesComponent.start();
		ListCoursesRegisteredComponent.start();
		ListStudentsRegisteredComponent.start();
		ExecutiveComponent.start();
		ListPendingCompulsoryCoursesComponent.start();
		RegisterStudentIntelliSectionComponent.start();
		ListCoursesTakenComponent.start();

	} // main

}